﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Guest.ascx.cs" Inherits="Hotel.UserControls.Guest" %>
<asp:Panel ID="pnlView" runat="server">
    <asp:Table runat="server" ID="tableSearch">
        <asp:TableRow>
            <asp:TableCell>
                First Name

            </asp:TableCell>
            <asp:TableCell>
                <asp:TextBox ID="FirstTextBox" runat="server" CssClass="textbox"></asp:TextBox>
            </asp:TableCell>
            <asp:TableCell>Last Name</asp:TableCell>

            <asp:TableCell>
                <asp:TextBox ID="LastTextBox" runat="server" CssClass="textbox"></asp:TextBox>
            </asp:TableCell>

            <asp:TableCell>Phone</asp:TableCell>
            <asp:TableCell>
                <asp:TextBox ID="PhoneTxtBox" runat="server" CssClass="textbox"></asp:TextBox>
            </asp:TableCell>

            <asp:TableCell>Email</asp:TableCell>

            <asp:TableCell>
                <asp:TextBox ID="EmailTxtBox" runat="server" CssClass="textbox"></asp:TextBox>
            </asp:TableCell>
            <asp:TableCell>
                <asp:Button ID="btnSearch" runat="server" Text="Go" OnClick="btnSearch_Click " />
            </asp:TableCell>
        </asp:TableRow>

    </asp:Table>
    <asp:GridView ID="gvGuest" runat="server" CellPadding="0" CellSpacing="0" HeaderStyle-BackColor="#EAEAEA"
        AutoGenerateColumns="false" CssClass="grid" AlternatingRowStyle-CssClass="gridAltRow"
        RowStyle-CssClass="gridRow" ShowFooter="False" EditRowStyle-CssClass="gridEditRow">
        <AlternatingRowStyle CssClass="gridAltRow"></AlternatingRowStyle>
        <Columns>

            <asp:TemplateField HeaderText="Name">
                <ItemTemplate>
                    <div style="overflow: hidden; text-overflow: ellipsis; width: 120px;">
                <asp:LinkButton ID="lnkView" runat="server" Text='<%# Eval("FirstName")+" "+ Eval("LastName") %>'
                    OnClientClick="alert('coming soon');return false;"></asp:LinkButton></div>
                </ItemTemplate>

            </asp:TemplateField>
            <asp:BoundField DataField="BirthDate" HeaderText="DOB" NullDisplayText="22/09/2012" />
            <asp:BoundField DataField="Age" HeaderText="Age" />
            <asp:BoundField DataField="Gender" HeaderText="Gender" />
            <asp:BoundField DataField="Nationality" HeaderText="Nationality" />
            <asp:TemplateField HeaderText="Email">
                <ItemTemplate>
                    <div style="overflow: hidden; text-overflow: ellipsis; width: 100px;">
                 <%#Eval("Email") %></div>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Phone">
                <ItemTemplate>
                    <div style="overflow: hidden; text-overflow: ellipsis; width: 100px;">
                 <%#Eval("CountryCode") %> &nbsp;<%#Eval("Phone") %></div>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:BoundField DataField="Occupation" HeaderText="Occupation" />
            <asp:TemplateField HeaderText="Address">
                <ItemTemplate>
                    <div style="overflow: hidden; text-overflow: ellipsis; width: 100px;">
                 <%#Eval("Address") %></div>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="PassportNumber" HeaderText="PassportNumber" />
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID="lnkEdit" runat="server" Text="Edit"
                        CommandName='<%#Eval("GuestID") %>' OnCommand="lnkEdit_Command"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>

        <EditRowStyle CssClass="gridEditRow"></EditRowStyle>

        <HeaderStyle BackColor="#EAEAEA"></HeaderStyle>

        <RowStyle CssClass="gridRow"></RowStyle>

    </asp:GridView>

    <div style="height: 25px; padding-top: 2px;"> &nbsp;<asp:LinkButton ID="btnAdd" runat="server" Text="Add Guest" 
            OnClick="btnAdd_Click"/> </div>
    <asp:HiddenField ID="hdnMode" runat="server" />
    <asp:HiddenField ID="hdnGuestID" runat="server" />
</asp:Panel>

<div style="padding: 10px 10px 10px 10px;">
<asp:Panel ID="pnlAdd" runat="server" Visible="false" Width="500px">
    <div style="background-color:#006899;height:25px; vertical-align:bottom;padding-top:5px;padding-left:2px;" >

        &nbsp; <asp:Label id="lblMessage" runat="server"  Text="" style="color:white;font-weight:bold;"></asp:Label>
    </div>
      <table cellpadding="0" cellspacing="0" width="500px" class="grid">

    <tr class="gridAltRow">
        <td>
            First Name 
            
        </td>
          <td>
              <asp:TextBox ID="FirstNameTextBox" runat="server"   CssClass="textbox"  />
              <asp:RequiredFieldValidator ID="txtNameIRq" runat="server" ErrorMessage="First Name is Required"
                    SetFocusOnError="true"
                    ControlToValidate="FirstNameTextBox" ValidationGroup="save" Display="None"></asp:RequiredFieldValidator>
        </td>
          <td>Last Name
            
        </td>
        <td>
        <asp:TextBox ID="LastNameTextBox" runat="server" CssClass="textbox"
             />
         <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Last Name is Required"
                    SetFocusOnError="true"
                    ControlToValidate="LastNameTextBox" ValidationGroup="save" Display="None"></asp:RequiredFieldValidator>
            </td>
        

    </tr>
    <tr class="gridRow" >
        <td>
    BirthDate
       
        </td>
        
       
        <td>
        <asp:TextBox ID="BirthDateTextBox" runat="server" CssClass="textbox"/>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Birth Date is Required"
                    SetFocusOnError="true"
                    ControlToValidate="BirthDateTextBox" ValidationGroup="save" Display="None"></asp:RequiredFieldValidator>
       </td>
        <td>
        Age
        </td>
        <td>
        <asp:TextBox ID="AgeTextBox" runat="server" Text=''  CssClass="textbox"/>
             <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Age is Required"
                    SetFocusOnError="true"
                    ControlToValidate="AgeTextBox" ValidationGroup="save" Display="None"></asp:RequiredFieldValidator>
        </td>
     </tr>

    <tr class="gridAltRow"><td>Gender</td><td><asp:TextBox ID="GenderTextBox" runat="server" Text='' CssClass="textbox" />  <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Gender is Required"
                    SetFocusOnError="true"
                    ControlToValidate="GenderTextBox" ValidationGroup="save" Display="None"></asp:RequiredFieldValidator></td>
        <td>Nationality
</td>
        <td>
                
                <asp:TextBox ID="NationalityTextBox" runat="server"
            Text=''  CssClass="textbox"/></td></tr>
        
        
        
                    <tr class="gridRow">
                        <td>Email</td>
                        <td><asp:TextBox ID="EmailTextBox" runat="server" Text='' CssClass="textbox"/></td>
                        <td> CountryCode</td>
                        <td>  <asp:TextBox ID="CountryCodeTextBox" runat="server" CssClass="textbox"
            Text='' /></td>
                    </tr>
                    <tr class="gridAltRow">
                        <td>Phone</td>
                        <td>
        <asp:TextBox ID="PhoneTextBox" runat="server" Text='' CssClass="textbox"  />

                           <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Phone is Required"
                    SetFocusOnError="true"
                    ControlToValidate="PhoneTextBox" ValidationGroup="save" Display="None"></asp:RequiredFieldValidator>
                        </td>
                        <td>Occupation</td>
                        <td>

        <asp:TextBox ID="OccupationTextBox" runat="server" CssClass="textbox"
            Text='' /></td>
                    </tr>
                    <tr class="gridRow">
                        <td>Address</td>
                        <td>
        <asp:TextBox ID="AddressTextBox" runat="server" Text='' CssClass="textbox" /></td>
                        <td>HasProof </td>
                        <td>
  <asp:CheckBox ID="ChkProof" runat="server" />

        </td>
                    </tr>
                
                    <tr class="gridRow">
                        <td>
PassportNumber</td>
                        <td> <asp:TextBox ID="txtPassportNo" runat="server" CssClass="textbox"
            Text='' /></td>
                        <td>
 </td>
                        <td>  </td>
                    </tr>
                    <tr class="gridAltRow">
                        <td> 
</td>
                        <td> </td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>

    <tr><td></td><td></td><td></td><td style="text-align:right;">
        <asp:Button ID="BtnSave" runat="server" Text="Save" CssClass="button"  ValidationGroup="save"   OnClick="BtnSave_Click"></asp:Button>&nbsp;<asp:Button ID="btnCancel" 
            runat="server" Text="Cancel" CssClass="button" OnClick="btnCancel_Click"></asp:Button>
        <asp:ValidationSummary ID="vsInsert" runat="server" ShowMessageBox="true" ShowSummary="false"
                    ValidationGroup="save" Enabled="true" HeaderText="" />

                                   </td></tr>
                </table>
</asp:Panel>
    </div>
